<template>
  <h1>watch监听基本数据类型:{{count}}</h1>
  <button @click="changeCount">修改count</button>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "About",
});
</script>

<script setup lang="ts">
import {ref , watch} from "vue"

  let count = ref(100)
  watch(count,(newval , oldval)=>{
    console.log('watch监听到了' , newval , oldval);
  })
  const changeCount = () => {
    count.value++
  }

  
</script>